package com.spring_core_demos.factorybean;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.beans.factory.FactoryBean;

public class TodayFactoryBean implements FactoryBean<Date>{

	public Date getObject() throws Exception {
		SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
		String str = format.format(new Date());
		return format.parse(str);
	}

	public Class<?> getObjectType() {
		return Timestamp.class;
	}

	public boolean isSingleton() {
		return false;
	}

}
